<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/conf/config.php';

$db = mysql_connect($dbhost, $dbuser, $dbpass) or die("Connection Error: " . mysql_error());

mysql_select_db($dbname) or die("Error conecting to db.");

$result = mysql_query("SELECT COUNT(*) AS count FROM qr_members");
$row = mysql_fetch_array($result,MYSQL_ASSOC);

$SQL = "SELECT * FROM qr_members";
$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->records = $row['count'];

$i=0;
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
    $responce->rows[$i]['id']=$row['id'];
    $responce->rows[$i]['cell'] = array($row['id'],$row['username'],$row['userpass'],$row['CDATE'],$row['LDATE'],$row['rootuser']);
    $i++;
}        

echo json_encode($responce);
?>
 